﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NetSurveillance.WebApp.DataServices.Models;

namespace NetSurveillance.WebApp.Controllers
{
    public class MenuController : BaseController
    {
        public ActionResult CreateOrEditMenu(int? menuId = null)
        {
            //IList<SelectListItem> parentMenus;
            //if (!menuId.HasValue)
            //    parentMenus =
            //        DataProvider.MenuService.GetAllModels().Select(
            //            p => new SelectListItem {Text = p.Name, Value = p.Id.ToString(CultureInfo.InvariantCulture)}).ToList();
            //else
            //{
            //    parentMenus =
            //        DataProvider.MenuService.GetAllModels().Where(p => p.Id != menuId).Select(
            //            p => new SelectListItem { Text = p.Name, Value = p.Id.ToString(CultureInfo.InvariantCulture) }).ToList();
            //}
            //ViewBag.ParentMenus = parentMenus;
            //如果view中的dropdownlist没有生成data-val，则需要传递一个新的model对象
            return View();
        }
    }
}
